<?php include_stylesheets_for_form($form); ?>
<?php include_javascripts_for_form($form); ?>

<form class="form-horizontal" id="form_modelo_documento" action="<?php echo url_for('modelo_documento/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_modelo_documento='.$form->getObject()->getIdModeloDocumento() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="id_modelo_documento" value="<?php echo $form->getObject()->getIdModeloDocumento() ?>" />
<?php endif; ?>
	<?php echo $form->renderHiddenFields() ?>

	<?php echo $form->renderGlobalErrors() ?>

<table>
	<tr>
		<th><?php echo $form['id_tipo_documento']->renderLabel() ?></th>
		<td>
			<?php
	        	echo $form['id_tipo_documento']->render(
	        		array(
	        			'placeholder' => $form['id_tipo_documento']->getWidget()->getLabel()
	        		)
	        	)
	        ?>
	        <?php include_component('tipo_documento', 'botaoAdicionar'); ?>
	        <?php echo form_error('modelo_documento[id_tipo_documento]'); ?>
	    </td>
	</tr>
	<tr>
		<th><?php echo $form['st_modelo_documento']->renderLabel() ?></th>
		<td>
			<?php
	        	echo $form['st_modelo_documento']->render(
	        		array(
	        			'placeholder' => $form['st_modelo_documento']->getWidget()->getLabel()
	        		)
	        	)
	        ?>
	        <?php echo form_error('modelo_documento[st_modelo_documento]'); ?>
	    </td>
	</tr>
	<tr>
		<th><?php echo $form['ds_modelo_documento']->renderLabel() ?></th>
		<td>
			<?php
	        	echo $form['ds_modelo_documento']->render(
	        		array(
	        			'placeholder' => $form['ds_modelo_documento']->getWidget()->getLabel()
	        		)
	        	)
	        ?>
	        <?php echo form_error('modelo_documento[ds_modelo_documento]'); ?>
		</td>
	</tr>
</table>

<?php
	comandos_form(
		'<button class="btn btn-primary" type="submit">:: Salvar ::</button>',
		link_to(
			':: Listar ::',
			'modelo_documento/list',
			array('class' => 'btn')
		)
	);
?>
  
</form>